package chenxi.extension.jdk;

import java.util.ServiceLoader;

/**
 * @author bowen
 */
public class Test {

    public static void main(String[] args) {
        ServiceLoader<IRepository> serviceLoader = ServiceLoader.load(IRepository.class);
        for (IRepository demoService : serviceLoader) {
            System.out.println("class:" + demoService.getClass().getName());
            demoService.save("tom");
        }
    }
}
